package org.mdrtwell.jdk15;

public class SimpleCollection<T> {
	private T[]	tArray;
	private int	index	= 0;

	public T[] getTArray() {
		return tArray;
	}

	public void setTArray(T[] array) {
		tArray = array;
	}

	public SimpleCollection() {
		tArray = (T[]) new Object[10];
	}

	public SimpleCollection(int capacity) {
		tArray = (T[]) new Object[capacity];
	}

	public void add(T t) {
		tArray[index] = t;
		index++;
	}

	public T get(int i) {
		return tArray[i];
	}

	public int getLength() {
		return index;
	}
}
